/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.system.domain;


import com.koron.common.domain.BaseEntity;
import com.koron.system.discrete.BusinessManipulation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

@ApiModel(value = "操作日志", description = "操作日志实体类")
public class OperationLog extends BaseEntity {

    @ApiModelProperty(value = "模块标题", name = "title", required = true)
    private String title;

    @ApiModelProperty(value = "业务类型: 0其它 1新增 2修改 3删除 4授权 5导出 6导入 7强退 8清空 9确认", name = "businessManipulation", required = true)
    private Integer businessManipulation;

    @ApiModelProperty(value = "方法名称", name = "method", required = true)
    private String method;

    @ApiModelProperty(value = "操作人员", name = "operatorName", required = true)
    private String operatorName;

    @ApiModelProperty(value = "部门名称", name = "departmentName" )
    private String departmentName;

    @ApiModelProperty(value = "请求URL", name = "operationUrl", required = true)
    private String operationUrl;

    @ApiModelProperty(value = "主机地址", name = "operationIP", required = true)
    private String operationIP;

    @ApiModelProperty(value = "操作地点", name = "operationLocation" )
    private String operationLocation;

    @ApiModelProperty(value = "请求参数", name = "params" )
    private String params;

    @ApiModelProperty(value = "操作状态: 0正常 1异常", name = "status", required = true)
    private Integer status;

    @ApiModelProperty(value = "错误消息", name = "errorMsg" )
    private String errorMsg;

    @ApiModelProperty(value = "操作时间", name = "operationTime", required = true)
    private Date operationTime;


    @ApiModelProperty(value = "公司名称", name = "operationTime", required = true)
    private String orgName;


    @ApiModelProperty(value = "业务模块", name = "operationTime", required = true)
    private String businessModule;

    private String businessManipulationName;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getBusinessManipulation() {
        return businessManipulation;
    }

    public void setBusinessManipulation(Integer businessManipulation) {
        this.businessManipulation = businessManipulation;
        this.businessManipulationName = BusinessManipulation.valueOf(businessManipulation).getDescription();
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    public String getOperationUrl() {
        return operationUrl;
    }

    public void setOperationUrl(String operationUrl) {
        this.operationUrl = operationUrl;
    }

    public String getOperationIP() {
        return operationIP;
    }

    public void setOperationIP(String operationIP) {
        this.operationIP = operationIP;
    }

    public String getOperationLocation() {
        return operationLocation;
    }

    public void setOperationLocation(String operationLocation) {
        this.operationLocation = operationLocation;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public Date getOperationTime() {
        return operationTime;
    }

    public void setOperationTime(Date operationTime) {
        this.operationTime = operationTime;
    }

    public String getBusinessManipulationName() {
        return businessManipulationName;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getBusinessModule() {
        return businessModule;
    }

    public void setBusinessModule(String businessModule) {
        this.businessModule = businessModule;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("title", getTitle())
                .append("businessManipulation", getBusinessManipulation())
                .append("method", getMethod())
                .append("operatorName", getOperatorName())
                .append("departmentName", getDepartmentName())
                .append("operationUrl", getOperationUrl())
                .append("operationIP", getOperationIP())
                .append("operationLocation", getOperationLocation())
                .append("params", getParams())
                .append("status", getStatus())
                .append("errorMsg", getErrorMsg())
                .append("operationTime", getOperationTime())
                .toString();
    }

}
